import { Meta, StoryObj } from "@storybook/react/*";
import Icon from "./icon";

const meta:Meta<typeof Icon> = {
    title: 'Icons 图标',
    component: Icon,
    tags: ['autodocs'],
    parameters: {
        layout: 'centered',
    },
    argTypes: {
        icon:{
            type:'string',
            control: 'text',
            description: '图标名称',
        },
        theme:{
            type:'string',
            control: 'select',
            options:['primary','success','warning','danger','info'],
            description: '图标主题',
        },
    }
};

export default meta;

type Story = StoryObj<typeof meta>;

export const DiffThemeIcon: Story = {
    args: {
        size:'3x'
    },
    render:(args) => (
        <>
            <Icon {...args} theme="primary" icon="circle-info"/>
            <Icon {...args} theme="success" icon="check-circle"/>
            <Icon {...args} theme="warning" icon="circle-exclamation"/>
            <Icon {...args} theme="danger" icon="circle-xmark"/>
            <Icon {...args} theme="info" icon="circle-info"/>
        </>
    )
};
DiffThemeIcon.storyName = '不同主题的图标'

export const DiffSizeIcon: Story = {
    args: {
        size:'8x'
    },
    render:(args) => (
        <>
            <Icon {...args} theme="primary" icon="circle-info"/>
        </>
    )
};
DiffSizeIcon.storyName = '不同尺寸的图标'